package com.hopes.bizz.close.position.vo;

import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import lombok.Data;

import java.io.Serializable;
import java.util.Optional;

/**
 * @author yumr
 * @ProjectName bizz
 * @Description 危险品车辆总数 & 在线数量
 * @time 2024/1/31 13:42
 */
@Data
public class HazardCarTotalOnlineVO implements Serializable {

    private static final long serialVersionUID = -8861976813647514389L;

    /**
     * 企业名称
     */
    private Long orgId;

    /**
     * 危险品车数
     */
    private Integer totalNum;

    /**
     * 在线数量
     */
    private Integer onlineNum;


    public HazardCarTotalOnlineVO(Long orgId, Integer totalNum, Integer onlineNum) {
        this.orgId = orgId;
        this.totalNum = Optional.ofNullable(totalNum).orElse(0);
        this.onlineNum = Optional.ofNullable(onlineNum).orElse(0);
    }


    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.getOrgId());
    }
}
